import http from "./http";
const base = '/api/isv/';

// 公告接口版块
export default {
  // 批量导入团购票
  async importGroupTicketList(params) {
    return await http.post(`${base}ticket/importGroupTicketList`, params, true);
  },
  // 后台 导入国际票 团购
  async international_importGroupTicketList(params) {
    return await http.post(`${base}international/importGroupTicketList`, params, true);
  },
  // 导入国际票
  async importPersonalTicketList(params) {
    return await http.post(`${base}international/importPersonalTicketList`, params, true);
  },
  //得到报名表单字段
  async queryModelList(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}temp/queryModelList`, params);
  },
  // PC_根据条件_查询_票务档案_列表—订单维度 
  async queryTicketOrdersByData(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/queryTicketOrdersByData`, params);
  },
  // PC_根据订单id查询订单下的门票 
  async queryTicketByOrderId(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/queryTicketByOrderId`, params);
  },
  // PC_根据订单id作废门票
  async delTicketByOrderId(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/delTicketByOrderId`, params);
  },
  // PC_票类型列表_查询所有被启用的
  async queryTicketTypeListByEnable(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/queryTicketTypeListByEnable`, params);
  },
  //   团购票赠送
  async sendTicketByData(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/sendTicketByData`, params);
  },
  //   国际票赠送
  async nationSendTicketByData(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}/international/sendTicketByPersonal`, params);
  },
  // 后台 国际赠票 团购票 
  async sendGroupTicket(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}/international/sendGroupTicket`, params);
  },

  // 修改备注
  async updateTicketDetailByTicketId(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/updateTicketDetailByTicketId`, params);
  },
  // PC_根据条件_查询_票务档案_列表—门票维度 
  async queryTicketsByData(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/queryTicketsByData`, params);
  },
  async queryTicketTypeNumByActivityId(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/queryTicketTypeNumByActivityId`, params);
  },
  // 导出
  async exportTicketsByData(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}/ticket/exportTicketsByData`, params);
  },
  // PC_根据ticketId查询门票详情 
  async queryTicketInfoByTicketId(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/queryTicketInfoByTicketId`, params);
  },
  // 退款
  async returnTicketOrderByBillcode(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticketPurchasePC/returnTicketOrderByBillcode`, params);
  },

  // 得到价格组数据
  async getPriceList(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticketPurchasePC/queryTicketPrciceGroupListByProjectId`, params)
  },
  // 作废门票
  async delTicketByTicketId(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/delTicketByTicketId`, params)
  },
  // 个人票赠送
  async sendTicketByPersonal(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}ticket/sendTicketByPersonal`, params)
  },
  // 发票接口
  async queryInvoiceByPagination(params) {
    Object.assign(params, {
      isPay: "pay"
    });
    return await http.post(`${base}invoice/queryInvoiceByPagination`, params);
  },
  // 发票重新发送
  async sendEmailElectronicInvoice(params) {
    return await http.post(`${base}invoice/sendEmailElectronicInvoice`, params);
  },
  // 生成发票
  async createElectronicInvoice(params) {
    return await http.post(`${base}invoice/createElectronicInvoice`, params);
  },
  // 查询发票详情
  async qureyInvoiceById(params) {
    return await http.post(`${base}invoice/qureyInvoiceById`, params);
  },
  //编辑发票
  async updateInvoiceById(params) {
    return await http.post(`${base}invoice/updateInvoiceById`, params);
  },
  //导入有出错调用
  async errorFun(params) {
    return await http.post(`${base}ticket/import/addErrorImportLog`, params);
  }
}
